import uuid
import random
import time
import logging
from dataclasses import dataclass
import math
import sys
import pathlib
import os
from typing import List
import numpy
import inspect
from urllib.parse import quote_plus
import json

logger = logging.getLogger(__name__)

CURRENTDIR = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
PARENTDIR = os.path.dirname(CURRENTDIR)
sys.path.insert(0, CURRENTDIR)
sys.path.insert(0, PARENTDIR)

from mobile.common.akamaicrypto import AkamaiCrypto
from bmp212.motion import k_motionmanager
from bmp212.orientation import p_orientation
from mobile.common.devicedata import get_device


def uptime(start=time.time_ns() // 1000000):
    return (time.time_ns() // 1000000) - start


def quote(string):
    string = string.replace(" ", "_")
    return quote_plus(string)


@dataclass
class zformatter:
    b: float
    c: int
    d: str
    e: int
    f: int


@dataclass
class ncontainer:
    """
    package com.cyberfend.cyfsecurity.n;
    """

    a: List
    b: List
    c: int
    d: int


@dataclass
class gcontainer:
    """
    package com.cyberfend.cyfsecurity.g
    """

    a: int
    b: str
    c: int
    d: bool


@dataclass
class o_OrientationListener:
    """
    package com.cyberfend.cyfsecurity.o
    """

    e: bool
    f: bool
    g: bool
    h: bool
    i: int
    j: bool
    k: bool
    l: List
    m: List


@dataclass
class j_MotionListener:
    d: int
    e: bool
    f: bool
    g: bool
    h: bool
    i: bool
    j: float
    k: int
    l: float
    m: float
    n: float
    o: float
    p: float
    q: float
    r: float
    s: float
    t: float
    u: List


@dataclass
class Constants:
    """
    package com.cyberfend.cyfsecurity;d
    """

    a: int = 0
    b: str = "https://apim.cformanalytics.com/"
    c: str = "sensor_data"
    d: bool = False
    e: int = 0
    f: int = -1
    g: int = 0
    h: int = 1800000
    i: str = ""
    j: str = ""
    k: int = 50000
    l: int = 0
    m: int = 0
    n: int = 0
    o: int = 0
    p: int = 0
    q: int = -1

    def _a(self, starttime):
        logger.debug("Resetting constants")
        self.a = time.time_ns() // 1000000
        self.e = (time.time_ns() // 1000000) - starttime
        self.g = 0
        self.n = 0


@dataclass
class lContainer:
    """
    package com.cyberfend.cyfsecurity.l
    """

    a: float
    b: float
    c: float
    d: float
    e: float
    f: float
    g: float
    h: float
    i: float
    j: int
    k: int


@dataclass
class Eventparser:
    """
    package com.cyberfend.cyfsecurity.e
    """

    a: str = ""
    b: int = 0
    c: str = ""
    d: int = 0
    e: int = 0
    f: int = 0
    g: int = 0
    h: int = 0
    i: int = 0
    j: int = 0
    k: str = ""
    l: str = "-1"
    m: str = ""
    n: str = ""
    o: str = "default_performance"

    def reset(self):
        logger.debug("Resetting event result values")
        self.a = ""
        self.b = 0
        self.c = ""
        self.d = 0
        self.e = 0
        self.f = 0
        self.g = 0
        self.h = 0
        self.i = 0
        self.j = 0
        self.n = ""
        self.k = ""
        self.m = ""


class sensor_data(object):
    def __init__(self, orientation=True, motion=True, package="com.ae.ae"):
        """
        The idea is to keep state consistent across everal transformers on the same set of data

        """
        self.offset = random.randint(1, 500000)
        # offset from start time in ms
        self.starttime = (time.time_ns() // 1000000) - self.offset
        self.a = None
        self.b = k_motionmanager(
            b=False,
            c=0,
            d=0,
            e=0,
            f=[],
            g=[],
            h=[],
            i=0.0,
            j=0.0,
            k=0.0,
            l=0.0,
            m=0.0,
            n=0.0,
            o=0.0,
            p=0.0,
            q=0.0,
        )
        self.c = p_orientation(
            b=False, c=0, d=0, e=0, f=[], g=[], h=[], i=400.0, j=400.0, k=400.0
        )
        self.d = None
        self.e = False
        self.orientation = orientation
        self.motion = motion
        self.package = package
        self.constants = Constants()
        self.eventparser = Eventparser()
        self.devicestring = ""
        self.motionsensors = ""
        self.motionhash = ""
        self.observedevents = []
        self.window_height = 1800
        self.window_width = 1080
        self.touchevents = []
        self.o_orientationlistener = o_OrientationListener(
            e=False, f=False, g=False, h=False, i=0, j=False, k=False, l=[], m=[]
        )
        self.j_motionlistener = j_MotionListener(
            d=0,
            e=False,
            f=False,
            g=False,
            h=False,
            i=False,
            j=0.0,
            k=0,
            l=-1.0,
            m=-1.0,
            n=-1.0,
            o=-1.0,
            p=-1.0,
            q=-1.0,
            r=-1.0,
            s=-1.0,
            t=-1.0,
            u=[0.0, 0.0, 0.0],
        )
        self.sdkINT = 24

    def uptime(self):
        return time.time_ns() // 1000000 - self.starttime

    def generate_sd(self):
        if self.constants.e == 0:
            self.constants.e = self.uptime()
        if self.constants.a == 0:
            self.constants.a = time.time_ns() // 1000000

        self.eventparser.reset()
        if self.motion:
            self.j_motionlistener.e = True
            self.j_motionlistener.f = True
            self.j_motionlistener.c = True

        self.eventparser.n += ",2," + str(self.constants.a) + ";"

        self.ab_touchupdate()
        self.parse_touchevents()
        self.x_textchangemanager()

        if self.motion or self.orientation:

            typeo = random.randint(0, 2)
            str(typeo)
            gyros = numpy.load(
                pathlib.Path(__file__).parent.joinpath(
                    "gyros_90degrees_" + str(typeo) + ".npy"
                )
            ).tolist()
            accels = numpy.load(
                pathlib.Path(__file__).parent.joinpath(
                    "accel_90degrees_" + str(typeo) + ".npy"
                )
            ).tolist()
            mags = numpy.load(
                pathlib.Path(__file__).parent.joinpath(
                    "mag_90degrees_" + str(typeo) + ".npy"
                )
            ).tolist()
            gyrolen = len(gyros)
            accellen = len(accels)
            maglen = len(mags)
            gstart = random.randint(0, gyrolen - 100)
            astart = random.randint(0, accellen - 100)
            magstart = random.randint(0, maglen - 100)
            gyro = gyros[gstart : gstart + 100]
            t = random.choice([0, 1])
            if t == 0:
                gyro.reverse()
            accel = accels[astart : astart + 100]
            t = random.choice([0, 1])
            if t == 0:
                accel.reverse()
            mag = mags[magstart : magstart + 100]
            t = random.choice([0, 1])
            if t == 0:
                mag.reverse()

            i = 0
            while i < 100:
                self.o_orientationchange(gyro[i], 4)
                self.j_motionchange(gyro[i], 4)
                self.o_orientationchange(accel[i], 1)
                self.j_motionchange(accel[i], 1)
                self.o_orientationchange(mag[i], 2)
                self.j_motionchange(mag[i], 2)
                i += 1

            for e in self.observedevents:
                if isinstance(e, lContainer):
                    self.b.update(e)
                elif isinstance(e, ncontainer):
                    self.c.update(e)

        self.make_devicestring()
        str12 = self.make_sensordata()
        ak = AkamaiCrypto(self.starttime)
        logger.debug("Output: {}".format(str12))
        ak.import_rsakey(
            "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4sA7vA7N/t1SRBS8tugM2X4bByl0jaCZLqxPOql+qZ3sP4UFayqJTvXjd7eTjMwg1T70PnmPWyh1hfQr4s12oSVphTKAjPiWmEBvcpnPPMjr5fGgv0w6+KM9DLTxcktThPZAGoVcoyM/cTO/YsAMIxlmTzpXBaxddHRwi8S2NvwIDAQAB"
        )
        t = ak.encrypt_message(str12)
        logger.debug("Encrypted: {}".format(t))
        return t

    def feistelcipher(self, l, i):
        i2 = l
        i3 = 0
        i4 = l >> 32
        while i3 < 16:
            i5 = (i << i3) | (i >> (32 - i3) ^ i2) ^ i4
            i4 = i2
            i2 = i5
            i3 += 1
        j2 = (i2 & 4294967295) | (i4 << 32)
        return j2

    def o_orientationchange(self, event, sensor):
        i2 = 2
        uptimemillis = self.uptime()
        if not self.o_orientationlistener.h:
            self.o_orientationlistener.h = True
        if sensor == 9 or sensor == 1:
            self.o_orientationlistener.l = event
            self.o_orientationlistener.j = True
        elif sensor == 2:
            self.o_orientationlistener.m = event
            self.o_orientationlistener.k = True
        if self.o_orientationlistener.j and self.o_orientationlistener.k:
            if (
                uptimemillis - self.o_orientationlistener.i >= 100
                or self.constants.m == 1
            ):
                logger.debug(
                    "Orientation event elapsed time: {}".format(
                        uptimemillis - self.o_orientationlistener.i
                    )
                )
                if self.constants.m != 0:
                    z = True
                else:
                    z = False
                if not z:
                    i2 = 1
                self.constants.m = 0
                farray = self.o_orientationlistener.l
                farray2 = self.o_orientationlistener.m
                j2 = self.o_orientationlistener.i
                # gravity, geomagnetic
                self.observedevents.append(ncontainer(farray, farray2, j2, i2))
                self.o_orientationlistener.j = False
                self.o_orientationlistener.k = False

    def j_motionchange(self, event, sensor):
        uptimemillis = self.uptime()
        if not self.j_motionlistener.i:
            self.j_motionlistener.i = True
        if sensor == 4:
            if self.j_motionlistener.f:
                self.j_motionlistener.r = event[0]
                self.j_motionlistener.s = event[1]
                self.j_motionlistener.t = event[2]
                self.j_motionlistener.g = True
        elif sensor == 1 and self.j_motionlistener.e:
            self.j_motionlistener.l = event[0]
            self.j_motionlistener.m = event[1]
            self.j_motionlistener.n = event[2]
            farr = event
            nanotime = time.time_ns()
            time.sleep(random.uniform(0.01, 0.05))
            i3 = self.j_motionlistener.k + 1
            f2 = 1.0 / i3 / (nanotime - self.j_motionlistener.j) / 1000000000
            if math.isnan(f2) or math.isinf(f2):
                f2 = 0.0
            f3 = 0.18 / (f2 + 0.18)
            self.j_motionlistener.u[0] = (
                self.j_motionlistener.u[0] * f3 + (1.0 - f3) * farr[0]
            )
            self.j_motionlistener.u[1] = (
                self.j_motionlistener.u[1] * f3 + (1.0 - f3) * farr[1]
            )
            self.j_motionlistener.u[2] = (1.0 - f3) * farr[2] + self.j_motionlistener.u[
                2
            ] * f3
            farr2 = [0.0, 0.0, 0.0]
            farr2[0] = farr[0] - self.j_motionlistener.u[0]
            farr2[1] = farr[1] - self.j_motionlistener.u[1]
            farr2[2] = farr[2] - self.j_motionlistener.u[2]
            if math.isnan(farr2[0]) or math.isinf(farr2[0]):
                farr2[0] = 0.0
            if math.isnan(farr2[1]) or math.isinf(farr2[1]):
                farr2[1] = 0.0
            if math.isnan(farr2[2]) or math.isinf(farr2[2]):
                farr2[2] = 0.0
            self.j_motionlistener.o = farr2[0]
            self.j_motionlistener.p = farr2[1]
            self.j_motionlistener.q = farr2[2]
            self.j_motionlistener.l *= -1.0
            self.j_motionlistener.m *= -1.0
            self.j_motionlistener.n *= -1.0
            self.j_motionlistener.o *= -1.0
            self.j_motionlistener.q *= -1.0
            self.j_motionlistener.p *= -1.0
            self.j_motionlistener.h = True
        if self.j_motionlistener.g and self.j_motionlistener.h:
            if uptimemillis - self.j_motionlistener.d >= 100 or self.constants.l == 1:
                self.j_motionlistener.d = uptimemillis
                if self.constants.l != 0:
                    i2 = 2
                elif self.constants.l == 0:
                    i2 = 1
                self.constants.l = 0
                f4 = self.j_motionlistener.l
                f5 = self.j_motionlistener.m
                f6 = self.j_motionlistener.n
                f7 = self.j_motionlistener.o
                f8 = self.j_motionlistener.p
                f9 = self.j_motionlistener.q
                f10 = self.j_motionlistener.r
                f11 = self.j_motionlistener.s
                f12 = self.j_motionlistener.t
                j2 = self.j_motionlistener.d
                logger.debug(
                    "Data: ax: {} ay: {} az: {} agx: {} agy: {} agz: {} gx: {} gy: {} gz: {}".format(
                        f4, f5, f6, f7, f8, f9, f10, f11, f12
                    )
                )
                self.observedevents.append(
                    lContainer(
                        a=f4,
                        b=f5,
                        c=f6,
                        d=f7,
                        e=f8,
                        f=f9,
                        g=f10 * 100.0,
                        h=f11 * 100.0,
                        i=f12 * 100.0,
                        j=j2,
                        k=i2,
                    )
                )

    def abvar(self):
        return (
            self.eventparser.j == 1
            or self.eventparser.j == 6
            or (self.eventparser.j > 6 and (self.eventparser.j - 6) % 10 == 0)
        )

    def ab_touchupdate(self):
        """
        The outcome is a list of lists of dicts
        :return:
        """
        num_events = random.randint(1, 4)
        m_paths = []
        for i in range(num_events):
            this_event = []
            touch_points = random.randint(2, 10)
            offset_x = random.randint(1, int(self.window_width // 2))
            offset_y = random.randint(1, int(self.window_height // 2))
            start_x = self.window_width - offset_x
            start_y = self.window_height - offset_y
            move_points = touch_points - 2
            first_touch = {"type": 2, "x": start_x, "y": start_y}
            this_event.append(first_touch)
            time.sleep(random.uniform(0.01, 0.05))
            if move_points > 0:
                for q in range(move_points):
                    start_x += random.randint(-3, 3)
                    start_y += random.randint(-3, 3)
                    this_event.append({"type": 1, "x": start_x, "y": start_y})
            this_event.append(
                {
                    "type": 3,
                    "x": start_x + random.randint(-3, 3),
                    "y": start_y + random.randint(-3, 3),
                }
            )
            m_paths.append(this_event)
        self.touchevents = m_paths

    def parse_touchevents(self):
        parsed_list = []
        for each_period in self.touchevents:
            i2 = 1
            for touch_event in each_period:
                self.eventparser.j += 1
                self.constants.l = 1
                self.constants.m = 1
                self.eventparser.i += 1
                if (touch_event["type"] == 1 and self.eventparser.e < 50) or (
                    touch_event["type"] != 1 and self.eventparser.f < 50
                ):
                    mevent = {"a": touch_event, "b": touch_event["type"], "c": i2}
                    time.sleep(random.uniform(0.01, 0.05))
                    parsed_list.append(mevent)
                    if touch_event["type"] != 1:
                        i2 = 0

        for acvar in parsed_list:
            j = self.uptime()
            time.sleep(random.uniform(0.01, 0.02))
            if acvar["c"] == 1:
                d = "{},{},{},{},1,1,1,-1;".format(
                    acvar["b"], self.uptime() - j, acvar["a"]["x"], acvar["a"]["y"]
                )
                self.eventparser.a += d
                self.eventparser.b += (
                    self.uptime() - j + acvar["b"] + acvar["a"]["x"] + acvar["a"]["y"]
                )
                self.eventparser.e += 1
            else:
                d = "{},{},{},{},1,1,1,-1;".format(
                    acvar["b"], self.uptime() - j, acvar["a"]["x"], acvar["a"]["y"]
                )
                time.sleep(random.uniform(0.01, 0.02))
                self.eventparser.f += 1
                self.eventparser.a += d
                self.eventparser.b = (
                    self.uptime()
                    - j
                    + self.eventparser.b
                    + acvar["b"]
                    + acvar["a"]["x"]
                    + acvar["a"]["y"]
                )

    def x_textchangemanager(self):
        textchangelist = []
        self.eventparser.h = 0
        for i in range(random.randint(3, 8)):
            if self.eventparser.i <= 50:
                valueof = self.uptime() - self.constants.e
                if self.eventparser.h < 9:
                    time.sleep(random.uniform(0.01, 0.05))
                    textchangelist.append(gcontainer(int(valueof), "2", 94, False))

        for gvar in textchangelist:
            gs = str(gvar.b) + "," + str(gvar.a) + "," + str(gvar.c)
            if gvar.d:
                gs += ",1"
            gs += ";"
            time.sleep(random.uniform(0.01, 0.02))
            self.eventparser.c += gs
            self.eventparser.d += int(gvar.a) + int(gvar.b) + int(gvar.c)
            self.eventparser.g += 1
            self.eventparser.h += 1

    def make_devicestring(self):
        data = get_device()
        uptimemillis = self.uptime()
        registrreceiver = 1
        battery_level = random.randint(1, 99)
        lorientation = 1
        lang = "en"
        version_rel = data["version_rel"]
        i2 = 1
        z = False
        model = quote_plus(data["model"])
        bootloader = "unknown"
        if "hardware" in data.keys():
            hwbuild = data["hardware"]
        else:
            hwbuild = "unknown"
        str10 = "-1"
        packagename = self.package
        str11 = "-1"
        st = str(uuid.uuid4())
        i3 = 1
        adbenabled = 0
        codename = "REL"
        version_inc = data["version_inc"] if "version_inc" in data.keys() else "unknown"
        sdk_int = data["sdkint"]
        manufacturer = quote(data["manufacturer"])
        product = quote(data["product"])
        tags = "user"
        user = data["user"]
        buildtype = "release-keys"
        display = data["display"]
        board = quote(data["board"])
        brand = quote(data["brand"])
        device = quote(data["device"])
        host = data["host"]
        id = data["id"]
        fingerprint = (
            brand
            + "/"
            + product
            + "/"
            + device
            + ":"
            + version_rel
            + "/"
            + id
            + "/"
            + version_inc
            + ":"
            + buildtype
            + "/"
            + tags
        )
        devicestring = (
            "-1,uaend,-1,"
            + str(self.window_height)
            + ","
            + str(self.window_width)
            + ","
            + str(registrreceiver)
            + ","
            + str(battery_level)
            + ","
            + str(lorientation)
            + ","
            + lang
            + ","
            + version_rel
            + ","
            + str(i2)
            + ","
            + model
            + ","
            + bootloader
            + ","
            + hwbuild
            + ","
            + str10
            + ","
            + packagename
            + ","
            + str11
            + ",-1,"
            + st
            + ",-1,"
            + str(i3)
            + ","
            + str(adbenabled)
        )

        devicestring += (
            ","
            + codename
            + ","
            + version_inc
            + ","
            + str(sdk_int)
            + ","
            + manufacturer
            + ","
            + product
            + ","
            + tags
            + ","
            + buildtype
            + ","
            + user
            + ","
            + display
            + ","
            + board
            + ","
            + brand
            + ","
            + device
            + ","
            + fingerprint
            + ","
            + host
            + ","
            + id
        )
        self.eventparser.l = devicestring
        self.constants.p = self.uptime() - uptimemillis

    def qhashstring(self):
        """
        This isn't to hash a string but creates hashes based on timestamp and uptime
        :return:
        """
        i = 0
        i2 = 0
        try:
            uptimemillis = self.uptime()
            i3 = 1
            while i3 < 10000000:
                if (4508713 % i3 * 11) % 13 == 0:
                    i += 1
                if i3 % 100 == 0 and self.uptime() - uptimemillis > 2:
                    break
                i2 += 1
                i3 += 1
            i4 = i
            i5 = i2 / 100
            f = 33.34
            i6 = 0
            i7 = 0
            uptimemillis2 = self.uptime()
            i8 = 1
            while i8 < 1000000:
                f += i8
                if 19.239 * f / 3.56 < 10000.0:
                    i6 += 1
                if i8 % 100 == 0 and self.uptime() - uptimemillis2 > 2:
                    break
                i7 += 1
                i8 += 1
            i9 = int(i6)
            i10 = int(i7 / 100)
            i11 = 0
            i12 = 0
            uptimemillis3 = self.uptime()
            d = 1.0
            while d < 1000000.0:
                if math.sqrt(d) > 30.0:
                    i11 += 1
                if int(d) % 100 == 0 and self.uptime() - uptimemillis3 > 2:
                    break
                i12 += 1
                d += 1.0
            i13 = int(i11)
            i14 = int(i12 / 100)
            i15 = 0
            i16 = 0
            uptimemillis4 = self.uptime()
            i17 = 1
            while i17 < 1000000:
                if (
                    math.acos(round(i17 / 1000000, 2))
                    + math.asin(i17 / 1000000)
                    + math.atan(i17 / 1000000)
                    > 1.5
                ):
                    i15 += 1
                if i17 % 100 == 0 and self.uptime() - uptimemillis4 > 2:
                    break
                i16 += 1
                i17 += 1
            i18 = int(i15)
            i19 = int(i16 / 100)
            i20 = 0
            uptimemillis5 = self.uptime()
            i21 = 1
            while i21 < 1000000 and self.uptime() - uptimemillis5 <= 2:
                i20 += 1
                i21 += 1
            return "{},{},{},{},{},{},{},{},{}".format(
                int(i4),
                int(i5),
                int(i9),
                int(i10),
                int(i13),
                int(i14),
                int(i18),
                int(i19),
                int(i20),
            )
        except:
            return "-1,-1,-1,-1,-1,-1,-1,-1,-1"

    def u_astringhasher(self, s):
        if s is not None and s.lower() is not "":
            i = 0
            n = 0
            try:
                while i < len(s):
                    if s[i] < "\u0080":
                        n += ord(s[i])
                    i += 1
                return n
            except:
                return -2
        else:
            return -1

    def make_sensordata(self):
        uptimemillis = self.uptime()
        if self.eventparser.o == "default_performance":
            self.eventparser.o = self.qhashstring()
        st = self.eventparser.l
        a2 = self.u_astringhasher(st)
        valueof = random.randint(1, 2 ** 30 + 1)
        str2 = "{},{},{},{}".format(st, a2, valueof, int(self.constants.a / 2))

        b2 = self.b.b_b
        b2 = b2()
        pvar = self.c
        pvar.d = self.uptime()
        pvar.f = []
        pvar.g = []
        pvar.h = []
        pvar.c = 0
        b3 = self.c.b_b
        b3 = b3()
        kvar = self.b
        kvar.d = self.uptime()
        kvar.f = []
        kvar.g = []
        kvar.h = []
        kvar.c = 0
        str4 = self.eventparser.c
        str5 = self.eventparser.a
        str6 = self.eventparser.k
        str7 = self.eventparser.n
        str8 = "do_en" if self.orientation else "do_dis"
        str9 = "dm_en" if self.motion else "dm_dis"
        str10 = str8 + "," + str9 + ",t_en"
        uptimemillis2 = (self.uptime() - uptimemillis) * 1000
        currenttimemillis = time.time_ns() // 1000000 - self.constants.a
        i = currenttimemillis
        longvalue = self.eventparser.d + self.eventparser.b + b2.b + b3.b
        str11 = (
            str(self.eventparser.d)
            + ","
            + str(self.eventparser.b)
            + ","
            + str(int(b2.b))
            + ","
            + str(int(b3.b))
            + ","
            + str(longvalue)
            + ","
            + str((time.time_ns() // 1000000) - self.constants.a)
            + ","
            + str(self.eventparser.i)
            + ","
            + str(self.eventparser.j)
            + ","
            + str(b2.c)
            + ","
            + str(b3.c)
            + ","
            + str(self.constants.p * 1000)
            + ","
            + str(uptimemillis2)
            + ","
            + str(self.constants.q)
            + ","
            + str(
                self.feistelcipher(
                    longvalue << 32
                    | (
                        self.eventparser.i
                        + self.eventparser.j
                        + int(b2.c)
                        + int(b3.c & 4294967295)
                    ),
                    i,
                )
            )
            + ","
            + str(self.constants.a)
            + ",0"
        )
        str12 = (
            "2.1.2-1,2,-94,-100,"
            + str2
            + "-1,2,-94,-101,"
            + str10
            + "-1,2,-94,-105,-1,2,-94,-102,"
            + str6
            + "-1,2,-94,-108,"
            + str4
            + "-1,2,-94,-110,-1,2,-94,-117,"
            + str5
            + "-1,2,-94,-111,"
            + b2.a
            + "-1,2,-94,-109,"
            + b3.a
            + "-1,2,-94,-112,-1,2,-94,-115,"
            + str11
            + "-1,2,-94,-106,"
            + str(self.constants.f)
            + ","
            + str(self.constants.g)
            + "-1,2,-94,-70,-1,2,-94,-80,-1,2,-94,-120,"
            + self.eventparser.m
            + "-1,2,-94,-112,"
            + str(self.eventparser.o)
            + "-1,2,-94,-121,-1,2,-94,-103"
            + str7
        )
        return str12
